/**
 * Created by showtan on 2018/12/27.
 * 入口
 */

import React, {Component} from 'react';
import { AppRegistry } from 'react-native';
import App from './app/routes';
import CodePush from 'react-native-code-push';
// import App from './App';
import { name as appName } from './app.json';
import SplashScreen from 'react-native-splash-screen';
import dva from 'dva-no-router';                 
import models from './app/models/index';

CodePush.notifyAppReady(); //热更新
CodePush.sync({
  updateDialog: null,
  installMode: CodePush.InstallMode.ON_NEXT_RESTART
  // mandatoryInstallMode: CodePush.InstallMode.IMMEDIATE //立即更新
});
CodePush.disallowRestart(); 

console.disableYellowBox = true;

SplashScreen.hide();

const app = dva(); 
Object.keys(models).map(key => app.model(models[key]));       //model

app.router(() => <App />); 

AppRegistry.registerComponent(appName, () => app.start());
